{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "759b8b68-9bba-4402-9713-47718cc51b9f",
   "metadata": {},
   "source": [
    "(conditional-workflow)=\n",
    "# Running a conditional workflow\n",
    "\n",
    "This example demonstrates creating a workflow that runs a function based on the result of the previous function.\n",
    "\n",
    "**In this section**\n",
    "- [Prerequisite](#prerequisite)\n",
    "- [Create the project and its functions](#create-the-project-and-its-functions)\n",
    "- [Create the workflow](#create-the-workflow)\n",
    "- [Run the workflow with input_val > 5. Func_B is triggered](#input-gt-5)\n",
    "- [Run the workflow with input_val < 5. Func_C is triggered](#input-lt-5)\n",
    "\n",
    "\n",
    "## Prerequisite"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "263bac07",
   "metadata": {},
   "outputs": [],
   "source": [
    "import mlrun"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6e70de79",
   "metadata": {},
   "source": [
    "## Create the project and its functions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "347b2776",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "> 2024-02-12 16:29:38,982 [info] Project loaded successfully: {'project_name': 'workflow-based-on-results2'}\n"
     ]
    }
   ],
   "source": [
    "project = mlrun.get_or_create_project(\"condition-workflow\", \"./\", user_project=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "838bdd4c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting funcs.py\n"
     ]
    }
   ],
   "source": [
    "%%writefile funcs.py\n",
    "import time\n",
    "\n",
    "def func_A(context, input_value):\n",
    "    \n",
    "    context.logger.info(f\"Function A is running with input {input_value}\")\n",
    "    return int(input_value)\n",
    "\n",
    "def func_B(context):\n",
    "    \n",
    "    context.logger.info(f\"Function B is running now\")        \n",
    "    return \"Function B has been triggered\"\n",
    "\n",
    "def func_C(context):\n",
    "    \n",
    "    context.logger.info(f\"Function C is running now\")        \n",
    "    return \"Function C has been triggered\"\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8ccb572d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "> 2024-02-12 16:29:39,017 [warning] Failed to add git metadata, ignore if path is not part of a git repo: {'path': './', 'error': '/User/workflows/workflow-based-on-results'}\n",
      "> 2024-02-12 16:29:39,039 [warning] Failed to add git metadata, ignore if path is not part of a git repo: {'path': './', 'error': '/User/workflows/workflow-based-on-results'}\n",
      "> 2024-02-12 16:29:39,064 [warning] Failed to add git metadata, ignore if path is not part of a git repo: {'path': './', 'error': '/User/workflows/workflow-based-on-results'}\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Names with underscore '_' are about to be deprecated, use dashes '-' instead. Replacing 'func_A' underscores with dashes.\n",
      "Names with underscore '_' are about to be deprecated, use dashes '-' instead. Replacing 'func_B' underscores with dashes.\n",
      "Names with underscore '_' are about to be deprecated, use dashes '-' instead. Replacing 'func_C' underscores with dashes.\n"
     ]
    }
   ],
   "source": [
    "# Set the functions in the project\n",
    "func_A = project.set_function(\n",
    "    func=\"funcs.py\", name=\"func-A\", handler=\"func_A\", image=\"mlrun/mlrun\", kind=\"job\"\n",
    ")\n",
    "func_B = project.set_function(\n",
    "    func=\"funcs.py\", name=\"func-B\", handler=\"func_B\", image=\"mlrun/mlrun\", kind=\"job\"\n",
    ")\n",
    "func_C = project.set_function(\n",
    "    func=\"funcs.py\", name=\"func-C\", handler=\"func_C\", image=\"mlrun/mlrun\", kind=\"job\"\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "78a8bda8",
   "metadata": {},
   "source": [
    "## Create the workflow"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "858af640",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting workflow.py\n"
     ]
    }
   ],
   "source": [
    "%%writefile workflow.py\n",
    "\n",
    "from kfp import dsl\n",
    "from mlrun.platforms import auto_mount\n",
    "import os\n",
    "import sys\n",
    "import mlrun\n",
    "\n",
    "@dsl.pipeline(name=\"Condition pipeline\", description=\"Pipeline that runs a function based on the result of a previous function\")\n",
    "def kfpipeline(input_val):\n",
    "    project = mlrun.get_current_project()\n",
    "    \n",
    "    # Run first function with the input value given to the workflow\n",
    "    step_1 = mlrun.run_function('func-A', params={\"input_value\":str(input_val)}, returns=['first_func_res'])    \n",
    "\n",
    "    # Based on func_A result, we run either func_B or func_C\n",
    "    step_1_output = step_1.outputs[\"first_func_res\"]\n",
    "    \n",
    "    with dsl.Condition(step_1_output > 5) as condition1:\n",
    "        step_2 = mlrun.run_function('func-B', returns=['second_func_res'])\n",
    "    condition1.after(step_1)\n",
    "        \n",
    "    with dsl.Condition(step_1_output <= 5) as condition2:\n",
    "        step_2 = mlrun.run_function('func-C', returns=['second_func_res'])\n",
    "    condition2.after(step_1)\n",
    "\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "99fe4c59",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<mlrun.projects.project.MlrunProject at 0x7fea35651310>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "project.set_workflow(name=\"workflow-func\", workflow_path=\"workflow.py\")\n",
    "project.save()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "abcccaf7",
   "metadata": {},
   "source": [
    "(input-gt-5)=\n",
    "## Run the workflow with input_val > 5. Func_B is triggered"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4592bd72-2396-4ba1-958f-a3a8253de120",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>Pipeline running (id=6eb7fc4f-d4e5-45c6-9d18-875ed716d01c), <a href=\"https://dashboard.default-tenant.app.cust-cs-il-353.iguazio-cd2.com/mlprojects/workflow-based-on-results2-amite/jobs/monitor-workflows/workflow/6eb7fc4f-d4e5-45c6-9d18-875ed716d01c\" target=\"_blank\"><b>click here</b></a> to view the details in MLRun UI</div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Generated by graphviz version 2.43.0 (0)\n",
       " -->\n",
       "<!-- Title: kfp Pages: 1 -->\n",
       "<svg width=\"378pt\" height=\"188pt\"\n",
       " viewBox=\"0.00 0.00 378.48 188.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 184)\">\n",
       "<title>kfp</title>\n",
       "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-184 374.48,-184 374.48,4 -4,4\"/>\n",
       "<!-- decision&#45;pipeline&#45;r4cb5&#45;1556115761 -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>decision&#45;pipeline&#45;r4cb5&#45;1556115761</title>\n",
       "<ellipse fill=\"green\" stroke=\"black\" cx=\"282.24\" cy=\"-18\" rx=\"39.79\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"282.24\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">func&#45;b</text>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;r4cb5&#45;1727837811 -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>decision&#45;pipeline&#45;r4cb5&#45;1727837811</title>\n",
       "<polygon fill=\"white\" stroke=\"black\" points=\"88.24,-108 -0.24,-90 88.24,-72 176.72,-90 88.24,-108\"/>\n",
       "<text text-anchor=\"middle\" x=\"88.24\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">condition&#45;2</text>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;r4cb5&#45;1744615430 -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>decision&#45;pipeline&#45;r4cb5&#45;1744615430</title>\n",
       "<polygon fill=\"green\" stroke=\"black\" points=\"282.24,-108 193.76,-90 282.24,-72 370.72,-90 282.24,-108\"/>\n",
       "<text text-anchor=\"middle\" x=\"282.24\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">condition&#45;1</text>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;r4cb5&#45;1744615430&#45;&gt;decision&#45;pipeline&#45;r4cb5&#45;1556115761 -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>decision&#45;pipeline&#45;r4cb5&#45;1744615430&#45;&gt;decision&#45;pipeline&#45;r4cb5&#45;1556115761</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M282.24,-71.7C282.24,-63.98 282.24,-54.71 282.24,-46.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"285.74,-46.1 282.24,-36.1 278.74,-46.1 285.74,-46.1\"/>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;r4cb5&#45;841374319 -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>decision&#45;pipeline&#45;r4cb5&#45;841374319</title>\n",
       "<ellipse fill=\"green\" stroke=\"black\" cx=\"185.24\" cy=\"-162\" rx=\"38.99\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"185.24\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">func&#45;a</text>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;r4cb5&#45;841374319&#45;&gt;decision&#45;pipeline&#45;r4cb5&#45;1727837811 -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>decision&#45;pipeline&#45;r4cb5&#45;841374319&#45;&gt;decision&#45;pipeline&#45;r4cb5&#45;1727837811</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M165.14,-146.5C150.63,-136.02 130.87,-121.77 115.02,-110.33\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"116.83,-107.32 106.67,-104.3 112.73,-112.99 116.83,-107.32\"/>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;r4cb5&#45;841374319&#45;&gt;decision&#45;pipeline&#45;r4cb5&#45;1744615430 -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>decision&#45;pipeline&#45;r4cb5&#45;841374319&#45;&gt;decision&#45;pipeline&#45;r4cb5&#45;1744615430</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M205.34,-146.5C219.85,-136.02 239.61,-121.77 255.46,-110.33\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"257.75,-112.99 263.81,-104.3 253.65,-107.32 257.75,-112.99\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<graphviz.graphs.Digraph at 0x7feab3536970>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<h2>Run Results</h2><h3>[info] Workflow 6eb7fc4f-d4e5-45c6-9d18-875ed716d01c finished, state=Succeeded</h3><br>click the hyper links below to see detailed results<br><table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>uid</th>\n",
       "      <th>start</th>\n",
       "      <th>state</th>\n",
       "      <th>name</th>\n",
       "      <th>parameters</th>\n",
       "      <th>results</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td><div title=\"89d62d4a3e9d4dbda9058d91cd6094da\"><a href=\"https://dashboard.default-tenant.app.cust-cs-il-353.iguazio-cd2.com/mlprojects/workflow-based-on-results2-amite/jobs/monitor/89d62d4a3e9d4dbda9058d91cd6094da/overview\" target=\"_blank\" >...cd6094da</a></div></td>\n",
       "      <td>Feb 12 16:30:20</td>\n",
       "      <td>completed</td>\n",
       "      <td>func-b</td>\n",
       "      <td></td>\n",
       "      <td><div class=\"dictlist\">second_func_res=Function B has been triggered</div></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td><div title=\"8e5b208a83134884942574a7ed0ecc38\"><a href=\"https://dashboard.default-tenant.app.cust-cs-il-353.iguazio-cd2.com/mlprojects/workflow-based-on-results2-amite/jobs/monitor/8e5b208a83134884942574a7ed0ecc38/overview\" target=\"_blank\" >...ed0ecc38</a></div></td>\n",
       "      <td>Feb 12 16:29:48</td>\n",
       "      <td>completed</td>\n",
       "      <td>func-a</td>\n",
       "      <td><div class=\"dictlist\">input_value=6</div></td>\n",
       "      <td><div class=\"dictlist\">first_func_res=6</div></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "6eb7fc4f-d4e5-45c6-9d18-875ed716d01c"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "project.run(\n",
    "    workflow_path=\"workflow.py\", watch=True, arguments={\"input_val\": 6}, local=False\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "58d4c02c-9c68-42f3-832d-7933181f2f41",
   "metadata": {},
   "source": [
    "(input-lt-5)=\n",
    "## Run the workflow with input_val < 5. Func_C is triggered"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fa02732e-ec53-49e6-8074-62d1f1026415",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>Pipeline running (id=9f1337a5-3e9c-4957-b2e1-1e73744507da), <a href=\"https://dashboard.default-tenant.app.cust-cs-il-353.iguazio-cd2.com/mlprojects/workflow-based-on-results2-amite/jobs/monitor-workflows/workflow/9f1337a5-3e9c-4957-b2e1-1e73744507da\" target=\"_blank\"><b>click here</b></a> to view the details in MLRun UI</div>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<!-- Generated by graphviz version 2.43.0 (0)\n",
       " -->\n",
       "<!-- Title: kfp Pages: 1 -->\n",
       "<svg width=\"378pt\" height=\"188pt\"\n",
       " viewBox=\"0.00 0.00 378.48 188.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 184)\">\n",
       "<title>kfp</title>\n",
       "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-184 374.48,-184 374.48,4 -4,4\"/>\n",
       "<!-- decision&#45;pipeline&#45;lcqc8&#45;2272390804 -->\n",
       "<g id=\"node1\" class=\"node\">\n",
       "<title>decision&#45;pipeline&#45;lcqc8&#45;2272390804</title>\n",
       "<ellipse fill=\"green\" stroke=\"black\" cx=\"185.24\" cy=\"-162\" rx=\"38.99\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"185.24\" y=\"-158.3\" font-family=\"Times,serif\" font-size=\"14.00\">func&#45;a</text>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;lcqc8&#45;2785627231 -->\n",
       "<g id=\"node2\" class=\"node\">\n",
       "<title>decision&#45;pipeline&#45;lcqc8&#45;2785627231</title>\n",
       "<polygon fill=\"white\" stroke=\"black\" points=\"88.24,-108 -0.24,-90 88.24,-72 176.72,-90 88.24,-108\"/>\n",
       "<text text-anchor=\"middle\" x=\"88.24\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">condition&#45;1</text>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;lcqc8&#45;2272390804&#45;&gt;decision&#45;pipeline&#45;lcqc8&#45;2785627231 -->\n",
       "<g id=\"edge1\" class=\"edge\">\n",
       "<title>decision&#45;pipeline&#45;lcqc8&#45;2272390804&#45;&gt;decision&#45;pipeline&#45;lcqc8&#45;2785627231</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M165.14,-146.5C150.63,-136.02 130.87,-121.77 115.02,-110.33\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"116.83,-107.32 106.67,-104.3 112.73,-112.99 116.83,-107.32\"/>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;lcqc8&#45;2802404850 -->\n",
       "<g id=\"node3\" class=\"node\">\n",
       "<title>decision&#45;pipeline&#45;lcqc8&#45;2802404850</title>\n",
       "<polygon fill=\"green\" stroke=\"black\" points=\"282.24,-108 193.76,-90 282.24,-72 370.72,-90 282.24,-108\"/>\n",
       "<text text-anchor=\"middle\" x=\"282.24\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">condition&#45;2</text>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;lcqc8&#45;2272390804&#45;&gt;decision&#45;pipeline&#45;lcqc8&#45;2802404850 -->\n",
       "<g id=\"edge2\" class=\"edge\">\n",
       "<title>decision&#45;pipeline&#45;lcqc8&#45;2272390804&#45;&gt;decision&#45;pipeline&#45;lcqc8&#45;2802404850</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M205.34,-146.5C219.85,-136.02 239.61,-121.77 255.46,-110.33\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"257.75,-112.99 263.81,-104.3 253.65,-107.32 257.75,-112.99\"/>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;lcqc8&#45;886558234 -->\n",
       "<g id=\"node4\" class=\"node\">\n",
       "<title>decision&#45;pipeline&#45;lcqc8&#45;886558234</title>\n",
       "<ellipse fill=\"green\" stroke=\"black\" cx=\"282.24\" cy=\"-18\" rx=\"38.19\" ry=\"18\"/>\n",
       "<text text-anchor=\"middle\" x=\"282.24\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">func&#45;c</text>\n",
       "</g>\n",
       "<!-- decision&#45;pipeline&#45;lcqc8&#45;2802404850&#45;&gt;decision&#45;pipeline&#45;lcqc8&#45;886558234 -->\n",
       "<g id=\"edge3\" class=\"edge\">\n",
       "<title>decision&#45;pipeline&#45;lcqc8&#45;2802404850&#45;&gt;decision&#45;pipeline&#45;lcqc8&#45;886558234</title>\n",
       "<path fill=\"none\" stroke=\"black\" d=\"M282.24,-71.7C282.24,-63.98 282.24,-54.71 282.24,-46.11\"/>\n",
       "<polygon fill=\"black\" stroke=\"black\" points=\"285.74,-46.1 282.24,-36.1 278.74,-46.1 285.74,-46.1\"/>\n",
       "</g>\n",
       "</g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<graphviz.graphs.Digraph at 0x7feab3454f10>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<h2>Run Results</h2><h3>[info] Workflow 9f1337a5-3e9c-4957-b2e1-1e73744507da finished, state=Succeeded</h3><br>click the hyper links below to see detailed results<br><table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>uid</th>\n",
       "      <th>start</th>\n",
       "      <th>state</th>\n",
       "      <th>name</th>\n",
       "      <th>parameters</th>\n",
       "      <th>results</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td><div title=\"3d32a0e63f7e430584badeffb34676e2\"><a href=\"https://dashboard.default-tenant.app.cust-cs-il-353.iguazio-cd2.com/mlprojects/workflow-based-on-results2-amite/jobs/monitor/3d32a0e63f7e430584badeffb34676e2/overview\" target=\"_blank\" >...b34676e2</a></div></td>\n",
       "      <td>Feb 12 16:31:29</td>\n",
       "      <td>completed</td>\n",
       "      <td>func-c</td>\n",
       "      <td></td>\n",
       "      <td><div class=\"dictlist\">second_func_res=Function C has been triggered</div></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td><div title=\"4a893f313c41492ca0d1fc04a71fad06\"><a href=\"https://dashboard.default-tenant.app.cust-cs-il-353.iguazio-cd2.com/mlprojects/workflow-based-on-results2-amite/jobs/monitor/4a893f313c41492ca0d1fc04a71fad06/overview\" target=\"_blank\" >...a71fad06</a></div></td>\n",
       "      <td>Feb 12 16:31:00</td>\n",
       "      <td>completed</td>\n",
       "      <td>func-a</td>\n",
       "      <td><div class=\"dictlist\">input_value=3</div></td>\n",
       "      <td><div class=\"dictlist\">first_func_res=3</div></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "9f1337a5-3e9c-4957-b2e1-1e73744507da"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "project.run(\n",
    "    workflow_path=\"workflow.py\", watch=True, arguments={\"input_val\": 3}, local=False\n",
    ")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
